package com.ycw.controller.guoguo;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class RedirectionController {

	@RequestMapping("/toRegister")
	public String toIndex(){
		return "front/reg";
	}
	
	@RequestMapping("/toBackstageIndex")
	public String toBackstageIndex(){
		return "back/index";
	}
	
	@RequestMapping("/toBackProducts")
	public String toBackstageproducts(){
		return "back/products";
	}
	
	@RequestMapping("/toBackManages")
	public String toBackManages(){
		return "back/UsersManage";
	}
	
	@RequestMapping("/toBackProductInfo")
	public String toBackstageproductInfo(Integer psId, Model model){
		model.addAttribute("psId", psId);
		return "back/product-info";
	}
	
	@RequestMapping("/tofontProductInfo")
	public String tofontstageproductInfo(Integer psId, Model model){
		model.addAttribute("psId", psId);
		return "../product-detail";
	}
	
	@RequestMapping("/logout")
	public String logout(HttpSession session){
		session.invalidate();
		return "redirect:/admin_login.jsp";
	}
	
}
